With the gradual maturity of a wireless local area network (WLAN) technology, in a typical scenario of enterprise campus networks, it has become a trend to provide a WLAN wireless access function. The WLAN starts to be deployed in more and more campus networks, for example, enterprise offices, indoor/outdoor stadiums and gymnasiums, conference halls/theaters/exhibition halls, and classrooms/training centers, to provide users with wireless network access experience characterized by low costs, ultra-wideband, and stability and convenience anytime and anywhere.
Compared with wired access, one important advantage of the WLAN is that the WLAN supports mobility of users. It is an important subject of the WLAN to ensure smooth service experience during a roaming process of a user. Roaming refers to a case in which a service remains uninterrupted when a wireless terminal moves between access points (AP). When APs associated with the wireless terminal before and after the roaming of the wireless terminal join different service virtual local area networks (VLAN), the roaming is called layer 3 roaming. Generally, devices joining a same service VLAN indicate the devices belonging to a same gateway device. Therefore, the layer 3 roaming is generally also called cross-gateway roaming. In a scenario of the layer 3 roaming, to ensure that a service of a user remains uninterrupted, both an Internet Protocol (IP) address carried in a packet sent by the user and service VLAN information added by an AP cannot change, that is, the service VLAN information added by the AP associated before the roaming and the allocated IP address remain unchanged. However, the user already roams to a foreign network in which an AP joining a different service VLAN is located; therefore, the packet cannot be forwarded by a gateway device of the foreign network. In a conventional solution, a forwarding path is long, forwarding efficiency is low, and a user service interruption time during the roaming process is long. Therefore, how to better implement the layer 3 roaming is an urgent issue to be addressed.